home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(_root.vic)
- {
- this._y = 491.2;
- }
- if(!this.hitTest(_root.castle))
- {
- this._x += speed;
- }
- if(duped && _root.population < _root.poptot)
- {
- _root.population = _root.population + 1;
- _root.gold -= 500;
- i++;
- duplicateMovieClip(_root.cav,"cav" + i,16384 + (300 + i));
- _root["cav" + i]._x = -6.399999999999999;
- _root["cav" + i]._y = random(50) + 251.7;
- duped = false;
- }
- if(this.hitTest(_root.castle) && !attkin)
- {
- this.gotoAndPlay("attk");
- attkin = true;
- }
- if(this.dead && this._currentframe < 13)
- {
- this.gotoAndPlay("die");
- }
- l = _root.lvl;
- while(l < _root.lvl + 0.1)
- {
- if(this.hit.hitTest(_root["a" + l]))
- {
- this.gotoAndPlay("die");
- _root["a" + l].removeMovieClip();
- }
- l++;
- }
- if(this.hit.hitTest(_root.castle["th" + _root.castle.thing.i]))
- {
- this.gotoAndPlay("die");
- _root.castle["th" + _root.castle.thing.i].removeMovieClip();
- }
- if(this.dead)
- {
- this._x -= speed;
- }
- if(this.deadfull)
- {
- this._x = -1000000000;
- }
- }
-